"""
__project__ = 'automation'
__file_name__ = 'homeWork_1106'
__author__ = 'wang'
__time__ = '2020/11/6 19:57'
__product_name = PyCharm

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            佛祖保佑       永无BUG
"""

import random
# 剪刀石头布

win = 0

while win < 10:

    gameOptions = ['剪刀', '石头', '布']
    computer = gameOptions

    player = input('请输入您的选项，剪刀、石头、布')

    # ----------判断输入是否符合要求----------
    if player != '剪刀' and player != '石头' and player != '布':
        print('您的输入有误')

    else:
        # ----------获取到玩家输入内容的下标---------
        player_num = gameOptions.index(player)

        # ----------随笔电脑玩家的内容下标----------
        computer_num = random.randint(0, 2)

        # ----------根据玩家的下标和电脑玩家的下标进行比较----------
        if (player_num == 0 and computer_num == 2) or (player_num == 1 and computer_num == 0) or (player_num == 2 and computer_num == 1):
            print('您输入的是%s，电脑输入的是%s，这一局您胜利了' % (player, computer[computer_num]))

            # ----------如果胜利，胜利次数+1----------
            win += 1

        elif (player_num == computer_num):
            print('您输入的是%s，电脑输入的是%s，这一局是平局' % (player, computer[computer_num]))

        else:
            print('您输入的是%s，电脑输入的是%s，这一局是您输了' % (player, computer[computer_num]))

if win > 10:
    print('您胜利了10局')


# 一个学校，三个办公室，8位老师，随机分配办公室
import random
teacherOffice = [[], [], []]
teacherName = ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7', 'teacher8']

# teacherOffice[0].append(teacherName[0])
# teacherOffice[0].append(teacherName[1])
# print(teacherOffice)

for teacher in teacherName:   # 单独循环出所有老师
    a = random.randint(0, 2)  # 随机数，随机0,1,2，取值用于teacherOffice的下标
    teacherOffice[a].append(teacher)  # 将for循环取出teacherName，通过随机数产生的下标复制给teacherOffice

print(teacherOffice)


# str = 'a,hello',在字符串中查找hello
str1 = 'a,hello'
print(str1.find('hello'))

# str = 'a,b,c,d',用逗号分隔str的字符串，并保存到列表
str2 = 'a, b, c, d'
a = str2.split(',')
print(a)


# 将‘笔试题123A’中的123替换为‘进行中’
str3 = '笔试题123A'
print(str3.replace('123', '进行中'))


# 逆序输出一个字符串
str4 = '1234567890'
print(str4[::-1])

